package cn.edu.service.impl;

import cn.edu.dao.BookDao;
import cn.edu.dao.impl.BookDaoImpl;
import cn.edu.pojo.Book;
import cn.edu.service.BookService;

import java.util.List;

public class BookServiceImpl implements BookService {
    BookDao bookDao = new BookDaoImpl();
    @Override
    public int addBook(Book book) {
        return bookDao.addBook(book);
    }

    @Override
    public int deleteBook(String sn) {
        return bookDao.deleteBookbySn(sn);
    }

    @Override
    public int updateBook(Book book) {
        return bookDao.upDateBook(book);
    }

    @Override
    public List<Book> findBookLike(String info) {
        return bookDao.queryBookBylike(info);
    }

    @Override
    public List<Book> allBook() {
        return bookDao.queryBook();
    }

    @Override
    public Book getBookBySn(String sn) {
        return bookDao.queryBookBySn(sn);
    }
}
